package com.cw.base.common.model.enums;

import java.util.Arrays;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 模块编号
 *
 * @author chenw
 * @version $$Id: EnumModuleCode.java, v 0.1 2018/9/19 上午11:14 chenw Exp $$
 */
@Getter
@AllArgsConstructor
public enum EnumModuleCode {

    /** 未知模块 */
    UNKNOWN("000", "未知模块", "UNKNOWN"),
    CONSOLE("955", "管理台业务", "CONSOLE"),
    KYLINQUERY("951", "麒麟查询业务", "KYLINQUERY"),
    JEEYT("952", "后台管理", "JEEYT"),
    JEEYC("953", "核心管理", "JEEYC"),
    AUTOTEST("954", "自动化测试管理", "AUTOTEST"),
    ;

    /** 状态码 */
    private final String code;
    /** 状态描述 */
    private final String description;

    /** 缩写 */
    private String abbreviate;

    public static EnumModuleCode find(String code) {
        return Arrays.stream(EnumModuleCode.values()).filter(input -> input.getCode().equals(code)).findFirst().orElse(
            null);
    }
}
